-
Notifications
You must be signed in to change notification settings - Fork 532
[ENH] added afni 3dUnifize to utils #1906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1906 +/- ##
==========================================
+ Coverage 72.55% 72.93% +0.37%
==========================================
Files 1064 1061 -3
Lines 54164 53800 -364
Branches 7809 7738 -71
==========================================
- Hits 39301 39237 -64
+ Misses 13645 13349 -296
+ Partials 1218 1214 -4
Continue to review full report at Codecov.
|
nipype/interfaces/afni/utils.py
Outdated
(In other words, we do not recommend the use of 3dUniformize.) | ||
|
||
For complete details, see the `3dUnifize Documentation. | ||
<https://afni.nimh.nih.gov/pub../pub/dist/doc/program_help/3dUnifize.html>`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dUnifize.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
nipype/interfaces/afni/utils.py
Outdated
* Method: Obi-Wan's personal variant of Ziad's sneaky trick. | ||
(If you want to know what his trick is, you'll have to ask him, or | ||
read Obi-Wan's source code [which is a world of ecstasy and exaltation], | ||
or just read all the way to the end of this help output.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd consider removing AFNI inside jokes. This doesn't really add to the documentation, and it exists in the linked page. (Also "all the way to the end" doesn't apply in this docstring.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
nipype/interfaces/afni/utils.py
Outdated
name_template='%s_unif', | ||
desc='output image file name', | ||
argstr='-prefix %s', | ||
name_source='in_file') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this actually should be a file. My reading of the docs suggests that the actual output file would be named {out_file}{in_file}
(or maybe {out_file}_{in_file}
). I'd rewrite this as:
prefix = Str(argstr='-prefix %s', mandatory=True, desc='prefix of output dataset')
And then you'll need to add in Unifize
:
def _list_outputs(self):
outputs = super(Unifize, self)._list_outputs()
outputs['out_file'] = '{}{}'.format(self.inputs.prefix, self.inputs.in_file)
return outputs
Or whatever the actual format of the out file would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually out_file
is really a file, this is what AFNI expects even if it is called prefix.
I can not change the name to prefix
, because AFNICommandInputSpec
expects an input named out_file
and adds it in any case.
nipype/interfaces/afni/utils.py
Outdated
|
||
class UnifizeOutputSpec(TraitedSpec): | ||
out_file = File(desc='unifized file', | ||
exists=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add output for scale factor dataset, if ssave
is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
nipype/interfaces/afni/utils.py
Outdated
'from 1 mm.', | ||
argstr='-Urad %s') | ||
ssave = File( | ||
name_template='%s_scale', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would drop the name_template
here. There's no name_source
, and users probably don't want this on by default.
And maybe call it scale_file
for clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
fix website typo remove afni jokes
This LGTM. I assume the reason I didn't merge is that it's still marked WIP. Did you have any further work you wanted to do here? |
No, sorry. Initially I wanted also to add |
No description provided.